package com.aisino.utils;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "<{http://utils.aisino.com}RESPONSE_FPXXXZ>")
public class FPInfo {

	private String FPQQLSH;
	private String DDBH;
	private String FPHM;
	private String FPDM;
	private String CREATE_DATE;
	private String INVOICE_CHECK_CODE;
	private String PDF_URL;
	private String PDF_RED_URL;
	private String RETURN_CODE;
	private String RETURN_MASSAGE;

	public static FPInfo getInstance(String xmlStr) {
		FPInfo obj = new FPInfo();
		String[] split = xmlStr.split("\n\t");
		for (String ss : split) {
			if (ss.startsWith("<FPQQLSH>"))
				obj.FPQQLSH = ss.replace("<FPQQLSH>", "").replace("</FPQQLSH>", "");
			else if (ss.startsWith("<DDBH>"))
				obj.DDBH = ss.replace("<DDBH>", "").replace("</DDBH>", "");
			else if (ss.startsWith("<FPHM>"))
				obj.FPHM = ss.replace("<FPHM>", "").replace("</FPHM>", "");
			else if (ss.startsWith("<FPDM>"))
				obj.FPDM = ss.replace("<FPDM>", "").replace("</FPDM>", "");
			else if (ss.startsWith("<CREATE_DATE>"))
				obj.CREATE_DATE = ss.replace("<CREATE_DATE>", "").replace("</CREATE_DATE>", "");
			else if (ss.startsWith("<INVOICE_CHECK_CODE>"))
				obj.INVOICE_CHECK_CODE = ss.replace("<INVOICE_CHECK_CODE>", "").replace("</INVOICE_CHECK_CODE>", "");
			else if (ss.startsWith("<PDF_URL>"))
				obj.PDF_URL = ss.replace("<PDF_URL>", "").replace("</PDF_URL>", "");
			else if (ss.startsWith("<PDF_RED_URL>"))
				obj.PDF_RED_URL = ss.replace("<PDF_RED_URL>", "").replace("</PDF_RED_URL>", "");
			else if (ss.startsWith("<RETURN_CODE>"))
				obj.RETURN_CODE = ss.replace("<RETURN_CODE>", "").replace("</RETURN_CODE>", "");
			else if (ss.startsWith("<RETURN_MASSAGE>"))
				obj.RETURN_MASSAGE = ss.replace("<RETURN_MASSAGE>", "").replace("</RETURN_MASSAGE>", "").replaceAll("\n", "").replaceAll("\t", "").replaceAll("</RESPONSE_FPXX>", "");
			else if (ss.startsWith("<RETURN_MESSAGE>"))
				obj.RETURN_MASSAGE = ss.replace("<RETURN_MESSAGE>", "").replace("</RETURN_MESSAGE>", "").replaceAll("\n", "").replaceAll("\t", "").replaceAll("</RESPONSE_FPXXXZ>", "");
		}

		return obj;
	}

	public String getFPQQLSH() {
		return FPQQLSH;
	}

	public void setFPQQLSH(String fPQQLSH) {
		FPQQLSH = fPQQLSH;
	}

	public String getDDBH() {
		return DDBH;
	}

	public void setDDBH(String dDBH) {
		DDBH = dDBH;
	}

	public String getFPHM() {
		return FPHM;
	}

	public void setFPHM(String fPHM) {
		FPHM = fPHM;
	}

	public String getFPDM() {
		return FPDM;
	}

	public void setFPDM(String fPDM) {
		FPDM = fPDM;
	}

	public String getCREATE_DATE() {
		return CREATE_DATE;
	}

	public void setCREATE_DATE(String cREATE_DATE) {
		CREATE_DATE = cREATE_DATE;
	}

	public String getINVOICE_CHECK_CODE() {
		return INVOICE_CHECK_CODE;
	}

	public void setINVOICE_CHECK_CODE(String iNVOICE_CHECK_CODE) {
		INVOICE_CHECK_CODE = iNVOICE_CHECK_CODE;
	}

	public String getPDF_URL() {
		return PDF_URL;
	}

	public void setPDF_URL(String pDF_URL) {
		PDF_URL = pDF_URL;
	}

	public String getPDF_RED_URL() {
		return PDF_RED_URL;
	}

	public void setPDF_RED_URL(String pDF_RED_URL) {
		PDF_RED_URL = pDF_RED_URL;
	}

	public String getRETURN_CODE() {
		return RETURN_CODE;
	}

	public void setRETURN_CODE(String rETURN_CODE) {
		RETURN_CODE = rETURN_CODE;
	}

	public String getRETURN_MESSAGE() {
		return RETURN_MASSAGE;
	}

	public void setRETURN_MESSAGE(String rETURN_MESSAGE) {
		RETURN_MASSAGE = rETURN_MESSAGE;
	}

	@Override
	public String toString() {
		return "FPInfo [FPQQLSH=" + FPQQLSH + ", DDBH=" + DDBH + ", FPHM=" + FPHM + ", FPDM=" + FPDM + ", CREATE_DATE="
				+ CREATE_DATE + ", INVOICE_CHECK_CODE=" + INVOICE_CHECK_CODE + ", PDF_URL=" + PDF_URL + ", PDF_RED_URL="
				+ PDF_RED_URL + ", RETURN_CODE=" + RETURN_CODE + ", RETURN_MESSAGE=" + RETURN_MASSAGE + "]";
	}

}
